function sendAjaxRequest(){
      $(".error").hide();
      var hasError = false;
      var title = $("#title").val();
      var content = tinyMCE.get('text').getContent();

	content = content.replace(/\+/g, "&#43");
	content = content.replace(/\\/g, "&#92");
	if (title < 1) {
	  hasError = true;
	  $("#title_p").after('<span class="error">Podaj tytuł.</span>');
	}
	if (content < 10 ){
	  hasError = true;
	  $("#text").after('<div class="error">Wprowadź treść.</div>');
	}
	if (hasError == false ){
	var dane = $('#addnote').serialize();
	var cont = encodeURIComponent(content);
	dane = dane+"&tekst="+cont;
	$.get("key-gen.php",function(sResponse){
	  var key = sResponse;
	$.post("setup-save.php?set=editpage&key="+key,
	    dane,function(sResponse){
		    $('#addnote').hide();
		    $('#addnote').after('<div class="response"></div>');
		    $(".response").slideUp("normal").html(sResponse);

	      });
	   });
	}
	return false;
}